package net.lizhongxian.interview.hunktimes.entity;

import java.math.BigDecimal;

/**
 * 水果类
 */
public class Fruit extends Goods {

	/**
	 * 水果类构造方法，默认折扣为1，即没有折扣
	 *
	 * @param name  水果名称
	 * @param price 价格
	 */
	public Fruit(String name, BigDecimal price) {
		this.name = name;
		this.price = price;
		this.discount = new BigDecimal(1);
	}

	/**
	 * 水果类构造方法
	 *
	 * @param name     水果名称
	 * @param price    价格
	 * @param discount 折扣
	 */
	public Fruit(String name, BigDecimal price, BigDecimal discount) {
		this.name = name;
		this.price = price;
		this.discount = discount;
	}

	@Override
	public String toString() {
		return "Fruit{" +
				"name='" + name + '\'' +
				", price=" + price +
				", discount=" + discount +
				'}';
	}
}
